import { Global, Module } from '@nestjs/common';
import { JwtsService } from './jwts.service';
import { JwtModule } from '@nestjs/jwt';

@Global()
@Module({
  imports: [
    JwtModule.registerAsync({
      global: true,
      useFactory() {
        return {
          secret: 'HH',
          signOptions: {
            expiresIn: '30m', // 默认 30 分钟
          },
        };
      },
    }),
  ],
  providers: [JwtsService],
  exports: [JwtsService],
})
export class JwtsModule {}
